<extend name="./Common/View/EasyUI/form.html"/>
<block name="form">
    <div class="row">
        <div class="span12">
            <form method="post" id="pageForm" class="form-horizontal easyui-form" action="Sys/Menu/edit">
                <input type="hidden" name="id" value="{$vo.id}">
                <table class="table table-bordered table-striped">
                    <tbody>
                    <tr>
                        <th colspan="4">菜单信息</th>
                    </tr>
                    <tr>
                        <td class="revise-left" width="15%"><span class="text-error">*</span>所属应用:</td>
                        <td><input id="app_id" name="app_id" type="text" placeholder="请选择应用"
                                   class="easyui-validatebox" data-options="required:true,value:{$vo.app_id}">
                        </td>
                        <td class="revise-left" width="15%"><span class="text-error">*</span>上级菜单:</td>
                        <td width="35%">
                            <select id="pid" name="pid"></select>
                        </td>
                    </tr>

                    <tr>
                        <td class="revise-left" width="15%">菜单名称:</td>
                        <td>
                            <input name="title" type="text" value="{$vo.title}" placeholder="请输入菜单名称"
                                   class="easyui-validatebox" data-options="required:true,validType:'length[1,20]'">

                        </td>
                        <td class="revise-left" width="15%"><span class="text-error">*</span>菜单类型:</td>
                        <td width="35%">
                            <label class="radio inline"><input type="radio" name="type" value="1"
                                <if condition="$vo.status eq 1"> checked="checked"</if>
                                >内部功能</label>
                            <label class="radio inline"><input type="radio" name="type" value="2"
                                <if condition="$vo.status eq 2"> checked="checked"</if>
                                >外部链接</label>
                        </td>
                    </tr>
                    <tr>
                        <td class="revise-left" width="15%">菜单地址:</td>
                        <td width="60%" colspan="3">
                            <input name="url" type="text" value="{$vo.url|default='#'}" placeholder="请输入菜单地址"
                                   class="easyui-validatebox" data-options="required:true,validType:'length[1,50]'" style="width: 300px;">
                        </td>
                    </tr>
                    <tr>
                        <td class="revise-left" width="15%">菜单状态:</td>
                        <td >
                            <label class="radio inline"><input type="radio" name="status" value="1"
                                <if condition="$vo.status eq 1"> checked="checked"</if>
                                >启用</label>
                            <label class="radio inline"><input type="radio" name="status" value="0"
                                <if condition="$vo.status eq 0"> checked="checked"</if>
                                >禁用</label>
                            <span class="help-inline"></span>
                        </td>
                        <td class="revise-left" width="15%">菜单排序:</td>
                        <td >
                            <input class="easyui-numberspinner" style="width:100%;" name="sort" value="{$vo.sort}">
                        </td>
                    </tr>

                    <tr>
                        <td>菜单说明</td>
                        <td colspan="3">
                            <textarea cols="150" rows="3" name="remark" style="width: 400px;">{$vo.remark}</textarea>
                        </td>
                    </tr>

                    </tbody>
                </table>

            </form>
        </div>
    </div>
</block>

<block name="script">
    <script type="text/javascript">
        $(function () {
            app.combobox('#app_id', 'Sys/Application/lists', {onChange:function(newVal,oldVal){
                app.combotree('#pid', 'Sys/Menu/lists', {queryParams:{app_id:newVal}});
            }});
            app.combotree('#pid', 'Sys/Menu/lists', {queryParams:{app_id:{$vo.app_id}},value:{$vo.pid}});
        })
    </script>
</block>